package com.hopu.blb_erp.service.impl;

import com.hopu.blb_erp.mapper.UserRoleMapper;
import com.hopu.blb_erp.entity.UserRole;
import com.hopu.blb_erp.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;

    @Override
    public void add(UserRole userRole) {
        userRoleMapper.insert(userRole);
    }

    @Override
    public UserRole find(Long roleId, Long userId) {
        return userRoleMapper.select(roleId, userId);
    }

    @Override
    public void remove(Long userId) {
        userRoleMapper.delete(userId);
    }

    @Override
    public void modify(UserRole userRole) {
        userRoleMapper.update(userRole);
    }
}
